<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - Bootstrap Table</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="/admin/favicon.ico"> 
    <link href="/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/admin/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">

    <!-- <link href="/admin/css/plugins/iCheck/custom.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/chosen/chosen.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/cropper/cropper.min.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/switchery/switchery.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/datapicker/datepicker3.css" rel="stylesheet"> -->

    <!-- <link href="/admin/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet"> -->
    <!-- <link href="/admin/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet"> -->

    <link href="/admin/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">

    <!-- <link href="/admin/css/plugins/clockpicker/clockpicker.css" rel="stylesheet"> -->

    <link href="/admin/css/animate.css" rel="stylesheet">
    <link href="/admin/css/style.css?v=4.1.0" rel="stylesheet">
    

</head>

<body class="">
    <div class="wrapper wrapper-content animated fadeInRight">
        <!-- <div class="ibox-content"> -->
            <!-- <div class="row row-lg"> -->
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content" style="border:0">
                            <form action="/admin/bkuser/bkuser_update" method="post" class="form-horizontal m-t" id="signupForm" onsubmit="return false">
                                <input type="hidden" name='id' value="{{$piece->id}}">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">登录名：</label>
                                    <div class="col-sm-8">
                                        <input id="username" name="username" class="form-control" type="text" value="{{$piece->username}}">
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 将会成为您唯一的登入名</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">手机：</label>
                                    <div class="col-sm-8">
                                        <input id="tel" name="tel" class="form-control" type="text" aria-required="true" aria-invalid="false" class="valid" value="{{$piece->tel}}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">E-mail：</label>
                                    <div class="col-sm-8">
                                        <input id="email" name="email" class="form-control" type="email" value="{{$piece->email}}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">角色：</label>
                                    <div class="col-sm-8">
                                        <input id="role" name="role" class="form-control" type="text" readonly value="普通管理员">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">密码：</label>
                                    <div class="col-sm-8">
                                        <input id="password" name="password" class="form-control" type="password">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">确认密码：</label>
                                    <div class="col-sm-8">
                                        <input id="confirm_password" name="confirm_password" class="form-control" type="password">
                                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-8 col-sm-offset-3">
                                        <button class="btn btn-primary" id="edit" type="submit">提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            <!-- </div> -->
        <!-- </div> -->
    </div>



    <!-- 全局js -->
    <script src="/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/admin/js/layer.js"></script>

    <!-- 自定义js -->
    <script src="/admin/js/content.js?v=1.0.0"></script>


    <!-- Bootstrap table -->
    <script src="/admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="/admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

    <!-- jQuery Validation plugin javascript-->
    <script src="/admin/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="/admin/js/plugins/validate/messages_zh.min.js"></script>

    <script src="/admin/js/demo/form-validate-demo.js"></script>

    <!-- Peity -->
    <script src="/admin/js/demo/bootstrap-table-demo.js"></script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码，可删除-->

    <script>
        // 更新
        $('#edit').click(function(){
            var index = parent.layer.getFrameIndex(window.name); //获取当前iframe层索引
            $.ajax({
                url:'/admin/bkuser/bkuser_update',
                type:'POST',
                cache:false,
                data:$('#signupForm').serialize(), //将表单信息序列化(无法处理文件流)
                success:function(data){
                    // window.parent.location.reload();
                    if(data==1){
                        id=$('#id').val(); // 获取表单信息
                        username=$('#username').val();
                        tel=$('#tel').val();
                        email=$('#email').val();
                        password=$('#password').val();
                        layer.msg('修改成功',{'icon':1});
                        parent.$('#table').bootstrapTable('updateRow',{index:{{$nrow}},row:{'username':username,'tel':tel,'email':email}}); //更新父页面bt表格的数据
                    }else{
                        layer.msg('修改失败',{'icon':2});
                    }
                    setTimeout(function(){
                        parent.layer.close(index); //关闭当前iframe层
                    },1000);
                }
            }).done(function(){
                // window.parent.location.reload();
            }).fail(function(){
                layer.msg('请正确填写信息',{'icon':2});
            })
        })
    </script>

</body>

</html>
